/*****************************************************************************
*
*  PROJECT:		Eon Engine
*               
*  LICENSE:		
*
*  DEVELOPER:	
*
*****************************************************************************/

#ifndef EONCAMERA_H
#define EONCAMERA_H

#define _USE_MATH_DEFINES

#include <math.h>
#include <cmath>

#include <gl/glut.h>

#include "EonVector3.h"

namespace Eon
{
	class Camera
	{
		public:

			//////////////////////////////////////////////////////////
			//					Constructor							//
			//////////////////////////////////////////////////////////

			// Default constructor.
			Camera::Camera( void )					{ }

			//////////////////////////////////////////////////////////
			//					Deconstructor						//
			//////////////////////////////////////////////////////////

			// Default deconstructor.
			Camera::~Camera( void )					{ }

			//////////////////////////////////////////////////////////
			//					Accessor Methods					//
			//////////////////////////////////////////////////////////

			// Returns the camera's position vector.
			const Eon::Vector3& getPosition( void );
			// Returns the camera's rotation vector.
			const Eon::Vector3& getRotation( void );

			//////////////////////////////////////////////////////////
			//					Class Methods						//
			//////////////////////////////////////////////////////////

			// Set the camera's position vector.
			void setRotation( Eon::Vector3 newCameraRotation );
			// Set the camera's rotation vector.
			void setPosition( Eon::Vector3 newCameraPosition );

			// Initialization function.
			// Call once before rendering (init function).
			void init			( Eon::Vector3 cameraPosition, Eon::Vector3 cameraRotation );

			// Updates camera based on current position and rotation.
			// Call before rendering scene geometry.
			// Depth testing must be enabled, so call after drawing skybox/skydome/skyplane.
			void update			( void );

			// Move the camera forward in 3D space.
			void moveForward	( GLfloat cameraMovementSpeed );

			// Move the camera backward in 3D space.
			void moveBackward	( GLfloat cameraMovementSpeed );

			// Pan the camera to the left of the screen.
			void moveLeft( GLfloat cameraMovementSpeed );

			// Pan the camera to the right of the screen.
			void moveRight( GLfloat cameraMovementSpeed );

			// Move the camera in a positive direction on the Y-Axis.
			// (Towards the sky)
			void moveUp			( GLfloat distanceToMoveOnYAxis );
		
			// Move the camera in a negative direction on the Y-Axis.
			// (Towards the floor)
			void moveDown		( GLfloat distanceToMoveOnYAxis );

			// Rotate the camera in a negative direction around the Y-Axis.
			void rotateLeft		( GLfloat distanceRotatedOnYAxis );

			// Rotate the camera in a positive direction around the Y-Axis.
			void rotateRight	( GLfloat distanceRotatedOnYAxis );


		private:

			//////////////////////////////////////////////////////////
			//				Private Class Variables					//
			//////////////////////////////////////////////////////////

			// Eon::Vector3 containing coordinates for camera position.
			Eon::Vector3 cameraPosition;
			// Eon::Vector3 containing values for camera rotation on X, Y, Z axes.
			Eon::Vector3 cameraRotation;
	};
}

#endif // EONCAMERA_H